#include <iostream>
#include <vector>
using namespace std;

const int mod = 1e9 + 7;
int N,M;
vector<vector<vector<int> > > cache;

int dfs(int n,int m,int sum){
	if(n > N || m > M) return 0;
	if(sum < 0 || sum > M) return 0;
	if(sum == 0 && m < M) return 0;
	if(n < N && m == M) return 0;
	
	if(cache[n][m][sum] != -1) return cache[n][m][sum];
	
	if(n == N && m == M && sum == 0){
		return 1;
	}
	
	int ret = 0;
	
	if(sum > 0){
		
		ret = (ret + dfs(n+1,m,sum*2%mod)) % mod;

		ret = (ret + dfs(n,m+1,sum-1)) % mod;
	
	}
		
	cache[n][m][sum] = ret;
	return ret;
}

int main(){
	cin>>N>>M;
	cache.resize(N+1,vector<vector<int> >(M+1,vector<int>(M+1,-1)));

	int ret = dfs(0,0,2);
	cout<<ret<<endl; 
	return 0;
}
